package Underworld_Survival;
/**
 * 带权重的元素封装类
 * @param <T> 元素类型（如String）
 */
public class WeightedItem<T> {
    private final T item;    // 元素内容
    private final double weight; // 权重（概率）

    public WeightedItem(T item, double weight) {
        this.item = item;
        this.weight = weight;
    }

    public T getItem() { return item; }
    public double getWeight() { return weight; }
}
